﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using DigDes.DSchool.SUPS.DataAccess;
namespace DigDes.DSchool.SUPS.Web.UI
{
    /// <summary>
    /// Сводное описание для Handler1
    /// </summary>
    public class Handler1 : IHttpHandler
    {
        public void ProcessRequest(HttpContext ctx)
        {
            DataAccess.Database.CargoDAC obj = new DataAccess.Database.CargoDAC();
            int id = Convert.ToInt32(ctx.Request.QueryString["id"]);
        byte[]pict=obj.LoadImg(id);
        if (pict != null)
        {
            ctx.Response.ContentType = "image/jpeg";
            ctx.Response.OutputStream.Write(pict, 0, pict.Length);
        }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}